package cn.qingyun.gis.modules.baogan.service;

import cn.qingyun.gis.modules.baogan.entity.MicroStreetData;
import cn.qingyun.gis.modules.baogan.vo.request.*;
import cn.qingyun.gis.modules.baogan.vo.response.*;
import cn.qingyun.gis.modules.scenes.entity.PoiScenario;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

public interface MicroStreetDataService extends IService<MicroStreetData> {

    /**
     * 看管划分-基本信息查询
     *
     * @param request
     * @return
     */
    StreetBaseResponse getWatchDivisionBaseInfo(IdRequest request);

    /**
     * 面数据详情查询
     *
     * @param microGridCode
     * @param id
     * @param types
     * @return
     */
    PolygonDetailRes selectStreetDetail(String microGridCode, String id, List<String> types);

    List<TeamItemVo> listTeam(GridCodeAndKeyListRequest request);

    Set<ChannelItemVo> listChannel(GridCodeAndKeyListRequest request);

    /**
     * 获取面数据内企业列表
     * @param id
     * @return
     */
    List<EnterpriseResponse> selectEnterpriseList(String id);

    AoiBaseInfoVo getAoiBaseInfo(AoiBaseInfoGetRequest request);

    /**
     * 查询待审核面数据列表
     * @param request
     * @return
     */
    Page<MicroStreetAuditLogResp> selectAuditData(PendingAuditRequest request);

    /**
     * 周边查询
     * @param request
     * @return
     */
    List<PerimeterDataResp> selectPerimeterData(PerimeterRequest request);

    /**
     *
     * @param request
     * @return
     */
    List<PoiScenario> selectPerimeterPointData(PerimeterPointRequest request);

    /**
     * 审批页面查询面详情
     *
     * @param id
     * @param microGridCode
     * @param types
     * @return
     */
    PolygonDetailRes getReviewingDetail(String id, String microGridCode, List<String> types);

    void updateWKT(MicroStreetData streetData);

    MicroStreetData selectOneById(String id);

    boolean saveBoundary(MicroStreetData data);

    MicroStreetData selectParentByWkt(String wkt);

    List<String> selectPointInPolygon(String wkt);

    void updateParentIdById(List<String> pointIds, String id);

    /**
     * 根据id更新父id为空
     * @param pointIds
     * @param id
     */
    void updateParentIdNullById(List<String> pointIds, String id);

    AoiBaseInfoVo getQHBaseInfo(AoiBaseInfoGetRequest request);

    /**
     * 查询微网格下的数据（点、面）
     * @param request
     * @param wkt
     * @return
     */
    List<DataResponse> selectDataResponse(MicroDataRequest request,String wkt);

    List<StreetDataRes> selectDateList(BigDecimal rtLon, BigDecimal rtLat, BigDecimal lbLon, BigDecimal lbLat, String text, List<String> types);

    List<DataResponse> selectRepeatDataList(RepeatPolygonRequest request);

    MicroStreetData getMicroStreetDataById(String id);
}
